package com.example.publishsubscrible.topic;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class TopicConsumer {

    @RabbitListener(queues = TopicConfig.XIAOMI_QUEUE_NAME)
    public void msgHandler(String msg) {
        System.out.println("xiaomi = " + msg);
    }

    @RabbitListener(queues = TopicConfig.IPHONE_QUEUE_NAME)
    public void msgHandler2(String msg) {
        System.out.println("iphone = " + msg);
    }

    @RabbitListener(queues = TopicConfig.HONGMI_QUEUE_NAME)
    public void msgHandler3(String msg) {
        System.out.println("hongmi = " + msg);
    }
}
